package com.bluegalaxy.nhb.snservice.common.utils;

import org.apache.commons.codec.digest.DigestUtils;

/**
 * Created by IntelliJ IDEA.
 *
 * @author:
 * @date: 2018/9/14
 * @time: 9:47
 * @description: To change this template use File | Settings | File Templates.
 */
public class MD5Util {

    /**
     * 字符串转md5
     * @param content
     * @return
     */
    public static String string2md5(String content){
        return DigestUtils.md5Hex(content);
    }

    /**
     * 校验加密的
     * @param sign
     * @param content
     * @return
     */
    public static boolean validateSign(String sign,String content){
        return DigestUtils.md5Hex(content).equals(sign);
    }

}
